package shared; 

/**
 * BudgetBuoy
 * 
 * Simplify your personal expense management
 * 
 * @team cs2103jan13-w15-3j
 */

//--------------------------------------------------------------

/**
 * ReceiptItem Class
 * 
 * Description: Receipt item object
 *              It records a single item on a receipt, with its 
 *              name and cost.
 * 
 * @package shared
 * @author Li Yin (A0085686L)
 * @editor(s) -
 */

public class ReceiptItem {
	private String name;
	private int amt;
	private String serialNum;
	private String model;
	private String brand;
	private String details;
	private Receipt receipt;

	//constructor
	public ReceiptItem(String _name, int _amt, String _serialNum, String _model, String _brand, String _details, Receipt _receipt){
		name=_name;
		amt=_amt;
		serialNum=_serialNum;//empty string if this field is left empty
		model = _model;      //empty string if this field is left empty
		brand=_brand;        //empty string if this field is left empty
		details=_details;    //empty string if this field is left empty
		receipt = _receipt;
	}

	//getters
	public String getName(){
		return name;
	}
	public int getAmt(){
		return amt;
	}
	public String getSerial(){
		return serialNum;
	}
	public String getModel(){
		return model;
	}
	public String getBrand(){
		return brand;
	}
	public String getDetails() {
		return details;
	}
	public Receipt getReceipt(){
		return receipt;
	}

	//mutators
	public void modifyName(String newName){
		name=newName;
	}
	public void modifyAmt(int newAmt){
		amt=newAmt;
	}
	public void modifySerial(String newSerialNum){
		serialNum=newSerialNum;
	}
	public void modifyModel(String newModel){
		model=newModel;
	}
	public void modifyBrand(String newBrand){
		brand=newBrand;
	}
	public void modifyDetails(String details) {
		this.details = details;
	}

	@Override
	public String toString(){
		return this.getName()+"|"+this.getAmt()+"|"+this.getSerial()+"|"+this.getModel()+"|"+this.getBrand()+"|"+this.getDetails();
	}
}
